import { post,get } from '@/api/request'
/**
 * 学生相关接口
 */
export const studentApi = {
    addUrl(url){
        return '/easstudent/student'+url
    },
    getStudentInfo(id){
        return get(this.addUrl('/info/'+id))
    },
    getmyInfo(){
        return get(this.addUrl('/info'))
    },
    listStudent(data){
        return post(this.addUrl('/list'),data)
    },
    listName(){
        return get(this.addUrl('/listname'))
    },
    deleteStudent(data){
        return post(this.addUrl('/delete'),data)
    },
    saveStudent(data){
        return post(this.addUrl('/save'),data)
    },
    updateStudent(data){
        return post(this.addUrl('/update'),data)
    },
    saveOrUpdate(data,status){
        if(status =='save'){
            return this.saveStudent(data)
        }else if(status =='update'){
            return this.updateStudent(data)
        }
    },

}

/**
 * 宿舍安排相关接口
 */
export const dormitoryArrangementEntityApi = {
    addUrl(url){
        return '/easstudent/dormitoryarrangement'+url
    },
    getdaInfo(id){
        return get(this.addUrl('/info/'+id))
    },
    getMyda(){
        return get(this.addUrl('/getmyda'))
    },
    listda(data){
        return post(this.addUrl('/list'),data)
    },
    deleteda(data){
        return post(this.addUrl('/delete'),data)
    },
    clearRoom(data){
        return post(this.addUrl('/clearroom'),data)
    },
    saveda(data){
        return post(this.addUrl('/save'),data)
    },
    updateda(data){
        return post(this.addUrl('/update'),data)
    },
    saveOrUpdate(data,status){
        if(status =='save'){
            return this.saveda(data)
        }else if(status =='update'){
            return this.updateda(data)
        }
    },

}

/**
 * 就业去向相关接口
 */
 export const employmentDestinationApi = {
    addUrl(url){
        return '/easstudent/ed'+url
    },
    getedInfo(id){
        return get(this.addUrl('/info/'+id))
    },
    getUsered(id){
        return post(this.addUrl('/getusered'),id)
    },
    listed(data){
        return post(this.addUrl('/list'),data)
    },
    deleteed(data){
        return post(this.addUrl('/delete'),data)
    },
    saveed(data){
        return post(this.addUrl('/save'),data)
    },
    updateed(data){
        return post(this.addUrl('/update'),data)
    },
    saveOrUpdate(data,status){
        if(status =='save'){
            return this.saveed(data)
        }else if(status =='update'){
            return this.updateed(data)
        }
    },

}